import { getChannelsAPI } from '../../api/channel';
import { ChannelSaveId, ChannelSaveList } from './actionTypes';

export const getChannelsAction = () => {
  return async (dispatch) => {
    const res = await getChannelsAPI();
    dispatch({ type: ChannelSaveList, payload: res.data.channels });
  };
};

export const saveIdAction = (id) => ({
  type: ChannelSaveId,
  payload: id,
});
